<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/common/includes.jsp" %>

<script type="text/javascript" src="${ctx}/res/js/follow_unfollow.js" ></script>
<script type="text/javascript" src="${ctx}/res/js/comment_with_reply.js" ></script>
<script type="text/javascript" src="${ctx}/res/js/loadmore.js" ></script>
<script type="text/javascript" src="${ctx}/res/js/confirm_dialog.js"></script>

<div id="topic_view" class="light-gray-bg">
	<div class="right-sidebar clearfix">
		<div class="content">
			<%@ include file="include/view/content.jsp" %>
			<%@ include file="include/view/comment.jsp" %>
		</div>
		<div class="sidebar mtl">
			<%@ include file="include/view_popup/sidebar.jsp" %>
		</div>
	</div>
</div>

<div data-dom-id="confirm-dialog" class="confirm-dialog" style="display: none;">
	<div data-dom-id="confirm-message" class="confirm-message"></div>
	<div class="confirm-actions" align="right">
		<input type="button" data-dom-id="confirm-cancel" class="btn style3 medium" value="Cancel" /><input type="button" data-dom-id="confirm-ok" class="btn style1 medium mls" value="Ok" />
	</div>
</div>

<script type="text/javascript" charset="utf-8">

jq(document).ready(function() {
	
	if(!isNewFollowUnfollow) {
		isNewFollowUnfollow = true;
		new FollowUnfollow({
			'j_follow_unfollow_link' : jq('a[href="#follow_unfollow_link"]'),
			'_follow_url' : "${ctx}/users/follow",
			'_unfollow_url' : "${ctx}/users/unfollow"
		});
	}

	if(!isNewCommentWithReply) {
		isNewCommentWithReply = true;
		new CommentWithReply({
			'j_comment_add_form' : jq("[data-comment-dom-id=add-comment-form]"),
			'j_comment_reply_form' : jq("[data-comment-dom-id=add-reply-form]"),
			'j_comment_add_textarea' : jq("[data-comment-dom-id=add-comment-textarea]"),
			'j_comment_reply_textarea' : jq("[data-comment-dom-id=add-reply-textarea]"),
			'j_comment_entry_content' : jq("[data-comment-dom-id=entry-content]"),
			'j_comment_entry_options' : jq("[data-comment-dom-id=entry-options]"),
			'j_add_comment_link' : jq('a[href="#add_comment_link"]'),
			'j_add_reply_link' : jq('a[href="#add_reply_link"]'),
			'_delete_comment_url' : "${ctx}/comment/delete"
		});
	}

	if(!isNewLoadMore) {
		isNewLoadMore = true;
		new LoadMore({
			'j_view_more_button' : jq("[data-loadmore-dom-id=view-more-container] a")
		});
	}
	
	
});

</script>
